package com.heima.wemedia.contorller.v1;
import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.wemedia.dtos.WmUserDTO;
import com.heima.wemedia.service.WmUserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
 * @author lo
 */
@RestController
@RequestMapping("/login")
@Api(tags = "自媒体端登录")
public class LoginController {
    @Autowired
    private WmUserService wmUserService;

    /**
     * 自媒体端登录
     * @param dto 前端传递的参数 包括了用户名和密码
     * @return
     */
    @PostMapping("/in")
    @ApiOperation("登录")
    public ResponseResult login(@RequestBody WmUserDTO dto){
        return wmUserService.login(dto);
    }
}